<?php

use yii\helpers\Html;
use yii\widgets\LinkPager;
use yii\grid\GridView;
use app\common\Functions;

/**
 * @var yii\web\View $this
 * @var amnah\yii2\user\Module $module
 * @var array $actions
 */
global $regionTypes2;
global $prodAttrCodes;
$regionTypes2 = $regionTypes;
$module = $this->context->module;

$this->title = Yii::t('user', 'Yii 2 User');
?>
<div class="user-default-index">



    <?php


    ?>


    <div class="row">
        <?php

        //$per=$buildingInfo['TotalLendedAreas']/ $buildingInfo['TotalAreas'];//百分比
        if(!empty($buildingInfo['TotalAreas'])){
            $per=round($buildingInfo['TotalLendedAreas']/ $buildingInfo['TotalAreas']*100,2)."%";
            $pers=round($buildingInfo['TotalCanvass']/ $buildingInfo['TotalAreas']*100,2)."%";
        }


        if ($prod_spec_id==10002 && $yw2==2 )
        {

        $i = 0;
        $row = [];

        $row[$i]['md']     = 1;
        $row[$i]['bg']     = 'aqua';
        $row[$i]['num']    = $dataProvider->getTotalCount();

        if ($prod_spec_id==10002)
        {
            $row[$i]['text']   = '房源';
            $row[$i]['a']   = '#';
        }
        else
        {
            $row[$i]['text']   = '楼盘';
            $row[$i]['a']   = '#';
        }




//        $row[$i]['ion']    = 'fa-home';
        $row[$i]['unit']   = '';

        $i++;


            $row[$i]['md']     = 2;
            $row[$i]['bg']     = 'aqua';
            $row[$i]['num']    = $buildingInfo['TotalAreas'];
            $row[$i]['numd']    = $buildingInfo['TotalCanvass'];
            $row[$i]['nums']    = $buildingInfo['TotalLendedAreas'];
            $row[$i]['num1']  =  $per;//百分比
            $row[$i]['text']   = '总面积';
            $row[$i]['textd']   = '空置面积';
            $row[$i]['texts']   = '已租面积';
//        $row[$i]['ion']    = 'ion-pie-graph';
            $row[$i]['unit']   = '';
        if($yw2==3 || $yw2==2){
            $row[$i]['a']   = '/prod/prodinst/buildingmng';
        }else{
            $row[$i]['a']   = '/prod/prodinst/build';
        }



        $i++;

        if($totalProd ==1002) {
            $row[$i]['md'] = 2;
            $row[$i]['bg'] = 'aqua';
            $row[$i]['num'] = $buildingInfo['TotalLendedAreas'];
            $row[$i]['text'] = '已租面积' . $per;
//        $row[$i]['ion']    = 'fa-home';
            $row[$i]['unit'] = '';
            if($yw2==3 || $yw2==2){
                $row[$i]['a']   = '/prod/prodinst/buildingmng';
            }else{
                $row[$i]['a']   = '/prod/prodinst/build';
            }

        }

        $i++;

//        $row[$i]['md']     = 2;
//        $row[$i]['bg']     = 'green';
//        $row[$i]['num']    = $buildingInfo['TotalCanvass'];
//        $row[$i]['text']   = '空置面积'.$pers;
////        $row[$i]['ion']    = 'fa-hourglass-end';
//        $row[$i]['unit']   = '㎡';
//        $i++;

        $row[$i]['md']     = 2;
        $row[$i]['bg']     = 'aqua';
        $row[$i]['num']    = $buildingInfo['TotalAttractAreas'];
        $row[$i]['text']   = '可招商面积';
//        $row[$i]['ion']    = 'fa-diamond';
        $row[$i]['unit']   = '';
        if($yw2==3 || $yw2==2){
            $row[$i]['a']   = '/prod/prodinst/buildingmng';
        }else{
            $row[$i]['a']   = '/prod/prodinst/build';
        }

        $i++;


        $row[$i]['md']     = 1;
        $row[$i]['bg']     = 'aqua';
        $row[$i]['num']    = $buildingInfo['TotalTao'];
        $row[$i]['text']   = '本月成交·套';
//        $row[$i]['ion']    = 'fa-cny';
        $row[$i]['unit']   = '';
        $row[$i]['a']   = '#';
        $i++;

        $row[$i]['md']     = 2;
        $row[$i]['bg']     = 'aqua';
        $row[$i]['num']    = $buildingInfo['TotalSquare'];
        $row[$i]['text']   = '本月成交·m²';
//        $row[$i]['ion']    = 'ion-person-add';
        $row[$i]['unit']   = '';
        $row[$i]['a']   = '#';
        $i++;


            $row[$i]['md']     = 1;
            $row[$i]['bg']     = 'aqua';
            $row[$i]['num']    = 0;
            $row[$i]['text']   = '3天未更·套';
            //        $row[$i]['ion']    = 'ion-person-add';
            $row[$i]['unit']   = '';
            if ($whereQuery) {
                // 如果是组长,可以看组员的

                if ($model_mng->grade==1) {
                    $row[$i]['a']   = 'rooms-super-mangermng?state=1001&out_time=3';

                } elseif ($model_mng->grade==2) {
                    $row[$i]['a']   = 'rooms-mangermng?state=1001&out_time=3';

                }elseif($model_mng->grade==3){
                    $row[$i]['a']   = 'roomsmng?state=1001&out_time=3';
                }
            }

            $i++;

            $row[$i]['md']     = 1;
            $row[$i]['bg']     = 'aqua';
            $row[$i]['num']    = 0;
            $row[$i]['text']   = '3天未更·m²';
            //        $row[$i]['ion']    = 'ion-person-add';
            $row[$i]['unit']   = '';

            if ($whereQuery) {
                // 如果是组长,可以看组员的

                if ($model_mng->grade==1) {
                        $row[$i]['a']   = 'rooms-super-mangermng?state=1001&out_time=3';

                } elseif ($model_mng->grade==2) {
                        $row[$i]['a']   = 'rooms-mangermng?state=1001&out_time=3';

                }elseif($model_mng->grade==3){
                    $row[$i]['a']   = 'roomsmng?state=1001&out_time=3';
                }
            }
            $i++;
        }
        else{
            $i = 0;
            $row = [];

            $row[$i]['md']     = 2;
            $row[$i]['bg']     = 'aqua';
            $row[$i]['num']    = $dataProvider->getTotalCount();

            if ($prod_spec_id==10002)
            {
                $row[$i]['text']   = '房源';
                $row[$i]['a']   = '#';
            }
            else
            {
                $row[$i]['text']   = '楼盘';
                $row[$i]['a']   = '#';
            }




//        $row[$i]['ion']    = 'fa-home';
            $row[$i]['unit']   = '';

            $i++;


            $row[$i]['md']     = 2;
            $row[$i]['bg']     = 'aqua';
            $row[$i]['num']    = $buildingInfo['TotalAreas'];
            $row[$i]['numd']    = $buildingInfo['TotalCanvass'];
            $row[$i]['nums']    = $buildingInfo['TotalLendedAreas'];
            $row[$i]['num1']  =  $per;//百分比
            $row[$i]['text']   = '总面积';
            $row[$i]['textd']   = '空置面积';
            $row[$i]['texts']   = '已租面积';
//        $row[$i]['ion']    = 'ion-pie-graph';
            $row[$i]['unit']   = '';
            if($yw2==3 || $yw2==2){
                $row[$i]['a']   = '/prod/prodinst/buildingmng';
            }else{
                $row[$i]['a']   = '/prod/prodinst/build';
            }



            $i++;

            if($totalProd ==1002) {
                $row[$i]['md'] = 2;
                $row[$i]['bg'] = 'aqua';
                $row[$i]['num'] = $buildingInfo['TotalLendedAreas'];
                $row[$i]['text'] = '已租面积' . $per;
//        $row[$i]['ion']    = 'fa-home';
                $row[$i]['unit'] = '';
                if($yw2==3 || $yw2==2){
                    $row[$i]['a']   = '/prod/prodinst/buildingmng';
                }else{
                    $row[$i]['a']   = '/prod/prodinst/build';
                }

            }

            $i++;


            $row[$i]['md']     = 2;
            $row[$i]['bg']     = 'aqua';
            $row[$i]['num']    = $buildingInfo['TotalAttractAreas'];
            $row[$i]['text']   = '可招商面积';
//        $row[$i]['ion']    = 'fa-diamond';
            $row[$i]['unit']   = '';
            if($yw2==3 || $yw2==2){
                $row[$i]['a']   = '/prod/prodinst/buildingmng';
            }else{
                $row[$i]['a']   = '/prod/prodinst/build';
            }

            $i++;


            $row[$i]['md']     = 2;
            $row[$i]['bg']     = 'aqua';
            $row[$i]['num']    = $buildingInfo['TotalTao'];
            $row[$i]['text']   = '本月成交·套';
//        $row[$i]['ion']    = 'fa-cny';
            $row[$i]['unit']   = '';
            $row[$i]['a']   = '#';
            $i++;

            $row[$i]['md']     = 2;
            $row[$i]['bg']     = 'aqua';
            $row[$i]['num']    = $buildingInfo['TotalSquare'];
            $row[$i]['text']   = '本月成交·m²';
//        $row[$i]['ion']    = 'ion-person-add';
            $row[$i]['unit']   = '';
            $row[$i]['a']   = '#';
            $i++;
        }



        echo app\common\TBAdminLte::widget('col', $row);

        ?>


    </div>
</div>
